<template>
  <div class="Foot" >
    小红窝&nbsp;&nbsp;&nbsp;随时随地，猥琐发育
  </div>
</template>

<script>
    export default {
      name: "Foot",

      methods:{
        footLode(){
          document.querySelector(".Foot").style.position="fixed";
          console.log(1);
          let contentHeight = document.body.scrollHeight;//网页正文全文高度
          let winHeight = window.innerHeight;//可视窗口高度，不包括浏览器顶部工具栏
          if(!(contentHeight > winHeight)){
            document.querySelector(".Foot").style.position="fixed";
          } else {
            document.querySelector(".Foot").style.position="static";
          }
        },
      mounted(){
          this.footLode();
          window.addEventListener('resize',()=>{
            this.footLode();
        },false)
      }
      }
    }
</script>

<style scoped>
  .Foot{

    width: 100%;
    font-size:10px;
    height:20px;
    color: white;
    background-color: rgba(0, 0, 0, 0.88);
  }
</style>
